import { request } from '../../request';

export function fetchMenuTree() {
  return request({
    url: '/sys/menu/tree',
    method: 'GET',
  });
}

export function fetchRouterTree() {
  return request({
    url: '/sys/menu/routerTree',
    method: 'GET',
  });
}

export function fetchAddMenu(data: SysAuth.SysMenu) {
  return request({
    url: '/sys/menu/',
    data: data,
    method: 'POST',
  });
}

export function fetchUpdateMenu(data: SysAuth.SysMenu) {
  return request({
    url: '/sys/menu/',
    data: data,
    method: 'PUT',
  });
}

export function fetchDeleteMenu(id: Common.IdType) {
  return request({
    url: '/sys/menu/' + id,
    method: 'DELETE',
  });
}

export function fetchBatchAddMenuBtn(pid:Common.IdType,data: any) {
  return request({
    url: `/sys/menu/batchAddBtn/${pid}`,
    data: data,
    method: 'POST',
  });
}


